//#include <globalDefines.hpp>
//k1 编辑

if(isNil "minMapDis1") then {
	minMapDis1 = 1;
	layerMinMap = 597899;
	minimapZoomLevel2 = .15;
	TitleText ["左Ctrl+鼠标滚轮缩放地图.","Plain Down"];
} else {
	minMapDis1 = abs (minMapDis1 - 1);
};

minMap_11 = {
disableSerialization; 
layerMinMap CutRsc ["scanner","PLAIN"];
_map = (Map_Scaner select 0) displayCtrl 16;
//_mapBackground = (Map_Scaner select 0) displayCtrl 15;
//pos _mapPos = ctrlPosition _map;
//_mapPos set[ 0, safeZoneW + safeZoneX - (MINIMAPWIDTH  + 0.1322) ];
//_mapPos set[ 1, safeZoneH + safeZoneY - (MINIMAPHEIGHT + 0.139) ]; 		
//_map ctrlSetPosition _mapPos;
//_map ctrlShow true;
_map mapcenteroncamera true;
_map ctrlMapAnimAdd [0, minimapZoomLevel2, getPosASL player];
ctrlMapAnimCommit _map;
//_map ctrlCommit 0;
//pos _mbPos = ctrlPosition _mapBackground;
//_mbPos set[ 0, safeZoneW + safeZoneX - (MINIMAPWIDTH  + 0.134) ];
//_mbPos set[ 1, safeZoneH + safeZoneY - (MINIMAPHEIGHT + 0.142) ]; 				
//_mapBackground ctrlSetPosition _mbPos;		
//_mapBackground ctrlShow true;
//_mapBackground ctrlCommit 0; //ARMA2 right
if(minMapDis1 == 0) then {
//_map ctrlShow false;
//_mapBackground ctrlShow false;
layerMinMap cutText ["","PLAIN"];
};
};
call minMap_11;

if(minMapDis1 == 1) then {
minMapMouseZChanged = (findDisplay 46) displayAddEventHandler ["MouseZChanged", "if((inputAction 'CuratorGroupMod' != 0)&&{minMapDis1 ==1})then { if((_this select 1)> 0 && {minimapZoomLevel2 < 1})then {minimapZoomLevel2= minimapZoomLevel2+minimapZoomLevel2*0.1;call minMap_11}; if((_this select 1)< 0 && {minimapZoomLevel2 > 0.02})then {minimapZoomLevel2= minimapZoomLevel2-minimapZoomLevel2*0.05;call minMap_11}; Lctrl_29_DownKey = nil; [format['<t size=""0.5"" shadow=""1"" align=""right"">地图缩放: %1</t>', minimapZoomLevel2],0.36,0.79,0.05,0,0,30508]spawn BIS_fnc_dynamicText };"];
}else{
//waituntil {isnil "BIS_CONTROL_CAM"};
(findDisplay 46) displayRemoveEventHandler ["MouseZChanged", minMapMouseZChanged];
};


if (minMapDis1 == 1) then{
0 spawn {
disableSerialization; 
while {(minMapDis1 == 1)} do {
_uavControl = (UAVControl getConnectedUAV player) select 1;//
_ply = if(_uavControl == "")then[{vehicle player},{getConnectedUAV player}];//
_viewVec = positionCameratoWorld [0,0,0] vectorFromTo (positionCameraToWorld [0,0,50]);
_bearing = ((_viewVec select 0) atan2 (_viewVec select 1) + 360) % 360;
_dir = round _bearing; //看的方向
_headingsArray = [ "北 " , "东北", "东 ", "东南", "南 " , "西南", "西 ", "西北" ];
_quantisedDir = round(_dir/44);
if( _quantisedDir == 8 ) then { _quantisedDir = 0 };
_prefx="";
if( _dir < 100 ) then { _prefx = "0" };
if( _dir < 10 ) then { _prefx = "00" };

  _hr = daytime - (daytime % 1);
  _min =  floor(60 * (daytime % 1));
  _zero = if(_hr<10) then [{"0"}, {""}];
  _zero2 = if(_min<10) then [{"0"}, {""}];

_heading = format ["%1        %2%3° %4        %5%6:%7%8", mapGridPosition _ply, _prefx, _dir, (_headingsArray select _quantisedDir), _zero, _hr, _zero2, _min];

_control = (Map_Scaner select 0) displayCtrl 17;
_control ctrlSetText _heading;
//_control ctrlSetTextColor [1,1,0,1];		//字体颜色
//pos _controlPos = ctrlPosition _control;
//_controlPos set[ 0 , safeZoneW + safeZoneX - 0.35 ];
//_controlPos set[ 1 , HEADINGLABEL_Y - safeZoneY - 0.326 ];
//_control ctrlSetPosition _controlPos;	
//_control ctrlCommit 0;

_a = player;
sleep .2;
if(_a != player) then {call minMap_11};
};
}};

/*
if(minMapDis1 == 0) then {
_control ctrlShow false;
};*/







